package com.ruix.app.mapper;

import com.ruix.app.model.LessonInfo;
import com.ruix.app.util.LogUitl;

import org.json.JSONObject;

/**
 * Created by hadexs on 2017/5/11.
 */

public class LessonInfoMapper implements ApiMapper<LessonInfo>{

    @Override
    public LessonInfo transform(JSONObject response) {
        LessonInfo info = null;
        if (response != null) {
           JSONObject data =  response.optJSONObject("data");
            if (data != null){
               info = new LessonInfo().parse(data.optJSONObject("lesson"));
            }
        }
        return info;
    }
}
